<?
include ("common.php");
if (@fopen("env_path.php","r") != null) {
	include ("env_path.php");
}

function CreateDhcpConf($filepath)
{
	$fp = fopen($filepath, "w");
	fprintf ($fp, "<?\n");
    fprintf ($fp, "\$gsDhcpCmd = \"".$_POST[dhcpcmd]."\";\n");
	fprintf ($fp, "\$gsDhcpConf = \"".$_POST[dhcpconf]."\";\n");
	fprintf ($fp, "?>\n");
	fclose($fp);
}
if($_POST[mode] == "save")
{
	CreateDhcpConf("env_path.php");
}
?>

<html>
<head>
<title></title>
<head>
<body>
  <form action="<? $PHP_SELF ?>" method="POST">
  dhcp command <br>
  <input type="text" name="dhcpcmd" id="dhcpcmd" size="40" value="<?= $gsDhcpCmd?>"><br>
  <hr>
  dhcp config file path <br>
  <input type="text" name="dhcpconf" id="dhcpconf" size="40" value="<?= $gsDhcpConf ?>"><br>
  <hr>
  <input type="submit" name="btn_sub" value="save">
  <input type="hidden" name="mode" value="save">
  </form>
</body>
</html>
